{% extends "base.html" %}

{% block style %}
	<link rel="stylesheet" type="text/css" href="/messageboard/files/postliststyle.css?text/css" />
	<script type="text/javascript" src="/messageboard/files/md5.js"></script>
{% endblock %}

{% block pagetitle %}{{ appname }} :: {{ thread.title }}{% endblock %}

{% block title %}{{ thread.title }}{% endblock %}

{% block content %}
	<!--
	page index = {{ pageIndex }}
	lower bound = {{ lowerBound }}
	page count = {{ pagecount }}
	!-->
	<a href="/messageboard/create?&type=post&parentkey={{ thread.key }}">Reply</a><br />
	<div class="pagepath">
		{{ previouspagelink }} {{ partialPath }} {{ nextpagelink }}
	</div>
	<div class="postlist">
		{% for p in visiblePosts %}
			<div class="post">
				<a name="{{ p.key }}" />
				<div class="postheader">
					<a href="/messageboard/thread?&threadkey={{ thread.key }}#{{ p.key}}">{{ p.datecreated|date:"d-M-Y" }} {{ p.datecreated|date:"H:i A" }}</a><br />
					<div class="postusername">{{ p.user.nickname }}</div>
				</div>
				<table>
					<tr>
						<td>
							<div class="personinfo">
								<center>
									<script type="text/javascript">
										email = "{{ p.user.email|lower }}";
										hash = hex_md5(email);
										address = "http://www.gravatar.com/avatar/" + hash + ".jpg";
										document.write("<a href=\"http://en.gravatar.com/\"><img src=\"" + address + "\" alt=\"avatar of {{ post.author.nickname }}?r=r\" /></a>");
									</script>
								</center>
							</div>
						</td>
						<td>
							<div class="postcontent">
								{{ p.content|escape|linebreaksbr }}
							</div>
						</td>
					</tr>
				</table>
			</div>
		{% endfor %}
	</div>
	<div class="pagepath">
		{{ previouspagelink }} {{ partialPath }} {{ nextpagelink }}
	</div>
	<a href="/messageboard/create?&type=post&parentkey={{ thread.key }}">Reply</a><br />
{% endblock %}